package com.example.rtsp2;

import com.example.rtsp2.handler.VideoStreamHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * @Author: 杜科璇
 * @Description: 主应用程序类
 * @Date: 2025/9/5 19:07
 * @Version: 1.0
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class Rtsp2Application {

    @Value("${ffmpeg.fps:15}")
    private int fps;

    @Value("${ffmpeg.width:1280}")
    private int width;

    @Value("${ffmpeg.height:720}")
    private int height;

    public static void main(String[] args) {
        SpringApplication.run(Rtsp2Application.class, args);
    }

    @Bean
    public VideoStreamHandler videoStreamHandler() {
        return new VideoStreamHandler(fps, width, height);
    }
}